package com.hou.hpsj_springboot.controller;

import com.hou.hpsj_springboot.bean.Message;
import com.hou.hpsj_springboot.service.IMessageService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/messages")
public class MessageController {

    @Resource
    private IMessageService messageService;

    @GetMapping
    public List<Message> selectMessage() {
        System.out.println("查询所有");
        return messageService.selectAllMessages();
    }

}
